<template>
  <div class="film-desc">
    <div class="col">
      <div class="film-name">
        <span class="name">{{ detail.name }}</span>
        <span v-if="detail.filmType" class="type">{{ detail.filmType.name }}</span>
      </div>
      <div class="film-grade">
        <span class="grade">{{ detail.grade }}</span>
      </div>
    </div>
    <div class="film-category">{{ detail.category }}</div>
    <div class="film-premiere-time">{{ detail.premiereAt | dateFilter }}上映</div>
    <div class="film-nation-runtime">{{ detail.nation }} | {{ detail.runtime }}分钟</div>
    <div :class="isUnfold ? '' : 'film-synopsis'">{{ detail.synopsis }}</div>
    <div class="icon-moreunfold">
      <i class="iconfont icon-arrow-down" @click="isUnfold=!isUnfold"></i>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Description',
  props: {
    detail: {}
  },
  data () {
    return {
      isUnfold: false
    }
  },
  mounted () {
    // console.log(this.detail)
  }
}
</script>

<style lang="scss" scoped>
.film-desc {
  background-color: #fff;
  padding: 4vw;
  font-size: 3.47vw;
  color: #797d82;

  .col {
    color: #191a1b;
    font-size: 4.8vw;
    display: flex;
    justify-content: space-between;
    align-items: center;

    .film-name {
      display: flex;
      align-items: center;

      .name {
        margin-right: 7px;
      }

      .type {
        font-size: 9px;
        color: #ffffff;
        background-color: #d2d6dc;
        height: 14px;
        line-height: 14px;
        padding: 0 2px;
        border-radius: 2px;
      }
    }

    .film-grade {
      color: #ffb232;
      font-size: 18px;
      font-style: italic;
    }

    .film-grade::after {
      font-style: normal;
      font-size: 14px;
      content: ' 分';
    }
  }

  .film-category {
    margin-top: 4px;
  }

  .film-premiere-time {
    margin-top: 4px;
  }

  .film-nation-runtime {
    margin-top: 4px;
    margin-bottom: 12px;
  }

  .film-synopsis {
    height: 9vw;
    overflow: hidden;
  }

  .icon-moreunfold {
    text-align: center;
  }
}
</style>
